package masterlink.futures.vo;
import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Table;

import masterlink.futures.vo.FutpabReal.FutpabRealPk;
@Entity
@Table(name="FutmatDetail")
public class FutmatDetail implements Serializable{
	private static final long serialVersionUID = -7837804127952914719L;
	@EmbeddedId
	private FutmatDetailPk id;
	@Column(name="quantity")
	private Integer quantity;
	@Column(name="price")
	private Double Price;
	@Column(name="date1")
	private Integer date1;
	public FutmatDetailPk getId() {
		return id;
	}
	public void setId(FutmatDetailPk id) {
		this.id = id;
	}
	public Integer getQuantity() {
		return quantity;
	}
	public void setQuantity(Integer quantity) {
		this.quantity = quantity;
	}
	public Double getPrice() {
		return Price;
	}
	public void setPrice(Double price) {
		Price = price;
	}
	public Integer getDate1() {
		return date1;
	}
	public void setDate1(Integer date1) {
		this.date1 = date1;
	}
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("FutmatDetail [id=");
		builder.append(id);
		builder.append(", quantity=");
		builder.append(quantity);
		builder.append(", Price=");
		builder.append(Price);
		builder.append(", date1=");
		builder.append(date1);
		builder.append("]");
		return builder.toString();
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((Price == null) ? 0 : Price.hashCode());
		result = prime * result + ((date1 == null) ? 0 : date1.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result
				+ ((quantity == null) ? 0 : quantity.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		FutmatDetail other = (FutmatDetail) obj;
		if (Price == null) {
			if (other.Price != null)
				return false;
		} else if (!Price.equals(other.Price))
			return false;
		if (date1 == null) {
			if (other.date1 != null)
				return false;
		} else if (!date1.equals(other.date1))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (quantity == null) {
			if (other.quantity != null)
				return false;
		} else if (!quantity.equals(other.quantity))
			return false;
		return true;
	}
	@Embeddable
	public static class FutmatDetailPk implements Serializable{

		private static final long serialVersionUID = 9010493190491112658L;
		@Column(name="acno")
		private String acno;
		@Column(name="BROKER_ID")
		private String broker;
		@Column(name="trid")
		private String trid;
		@Column(name="buysell")
		private String buySell;
		@Column(name="tag1")
		private int tag1;
		@Column(name="tag2")
		private int tag2;
		public String getAcno() {
			return acno;
		}
		public void setAcno(String acno) {
			this.acno = acno;
		}
		public String getBroker() {
			return broker;
		}
		public void setBroker(String broker) {
			this.broker = broker;
		}
		public String getTrid() {
			return trid;
		}
		public void setTrid(String trid) {
			this.trid = trid;
		}
		public String getBuySell() {
			return buySell;
		}
		public void setBuySell(String buySell) {
			this.buySell = buySell;
		}
		public int getTag1() {
			return tag1;
		}
		public void setTag1(int tag1) {
			this.tag1 = tag1;
		}
		public int getTag2() {
			return tag2;
		}
		public void setTag2(int tag2) {
			this.tag2 = tag2;
		}
		@Override
		public String toString() {
			StringBuilder builder = new StringBuilder();
			builder.append("FutpabRealPk [acno=");
			builder.append(acno);
			builder.append(", broker=");
			builder.append(broker);
			builder.append(", trid=");
			builder.append(trid);
			builder.append(", buySell=");
			builder.append(buySell);
			builder.append(", tag1=");
			builder.append(tag1);
			builder.append(", tag2=");
			builder.append(tag2);
			builder.append("]");
			return builder.toString();
		}
		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result + ((acno == null) ? 0 : acno.hashCode());
			result = prime * result
					+ ((broker == null) ? 0 : broker.hashCode());
			result = prime * result
					+ ((buySell == null) ? 0 : buySell.hashCode());
			result = prime * result + tag1;
			result = prime * result + tag2;
			result = prime * result + ((trid == null) ? 0 : trid.hashCode());
			return result;
		}
	}
}
